﻿using Smile.Mvvm.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Smile.Mvvm.Service
{
    public interface IServiceBase<TModelBase, in TSearchCriterion>
        where TModelBase : ModelBase
        where TSearchCriterion : SearchCriterionBase<TSearchCriterion>, new()
    {
        // @Member functions
        Task<bool> CreateAsync(TModelBase model);
        Task<bool> UpdateAsync(TModelBase model);
        Task<bool> DeleteAsync(TModelBase model);
        Task<TModelBase> GetOneAsync(Guid id);
        Task<List<TModelBase>> GetAsync(TSearchCriterion standard);
    }

    public interface IServiceBase<TModelBase> : IServiceBase<TModelBase, SearchCriterionBase>
        where TModelBase : ModelBase
    {
    }
}
